#!/usr/bin/env python
# coding=utf-8

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkalidns.request.v20150109.AddDomainRecordRequest import AddDomainRecordRequest


client = AcsClient('<accessKeyId>', '<accessSecret>', 'cn-hangzhou')

request = AddDomainRecordRequest()  # 创建请求对象 - 实例
request.set_accept_format('json')
request.set_Value("3.0.3.0")        # 设置 记录值
request.set_Type("A")               # 设置 解析类型
request.set_RR("apitest1")          # 主记录名
request.set_DomainName("dns-example.com")

response = client.do_action_with_exception(request)
# python2:  print(response)
print(str(response, encoding='utf-8'))
